/*******************************************************************************
 * Copyright (c) 2014 Francesco Gabbrielli.
 * 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Public License v2.0
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * 
 * Contributors:
 *     Francesco Gabbrielli - initial API and implementation
 ******************************************************************************/
package it.francescogabbrielli.android.solidalapp;

import it.francescogabbrielli.android.solidalapp.SolidalApp.DataKey;

import java.util.EventObject;

public class DataEvent extends EventObject {
	
	private static final long serialVersionUID = -2419623349549747624L;

	private DataKey key;
	
	private boolean triggered;
	
	public DataEvent(Object source, DataKey key) {
		super(source);
		this.key = key;
	}
	
	public DataEvent(Object source, DataKey key, boolean triggered) {
		this(source, key);
		this.triggered = triggered;
	}
	
	public DataKey getKey() {
		return key;
	}
	
	public boolean isTriggered() {
		return triggered;
	}

	@Override
	public String toString() {
		return key+"("+triggered+")";
	}
}
